home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / dist-packages / checkbox / registries / filename.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  1.4 KB  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import logging
  5. from checkbox.properties import Path
  6. from checkbox.registry import Registry
  7.  
  8. class FilenameRegistry(Registry):
  9.     '''Base registry for containing files.
  10.  
  11.     The default behavior is to return the content of the file.
  12.  
  13.     Subclasses should define a filename parameter.
  14.     '''
  15.     filename = Path()
  16.     
  17.     def __init__(self, filename = None):
  18.         super(FilenameRegistry, self).__init__()
  19.         if filename is not None:
  20.             self.filename = filename
  21.         
  22.  
  23.     
  24.     def __str__(self):
  25.         logging.info('Reading filename: %s', self.filename)
  26.         return open(self.filename, 'r').read()
  27.  
  28.     
  29.     def items(self):
  30.         return []
  31.  
  32.  
  33.